"""
3. 游戏开始，需要加载4个求生者，1个监管者。接下来需要实现此代码流程。
    1. 园丁开局碰到了杰克，被杰ke普攻命中一次。
    2. 园丁逃跑成功，
    3. 杰克又找到了医生，医生被杰克普攻命中一次。
    3. 医生使用技能。
    4. 医生被杰克命中2次，倒地。

    === 流程2
    1. 律师开局被杰克普攻命中一次，又被技能命中一次，倒地
    2. 园丁被杰克普攻命中一次，
    3. 园丁逃跑
    4. 园丁找到医生，被医生治疗
"""
from src.day10.regulator import Jack, Regulator
from src.day10.survivors import Survivors, Gardener, Doctor, Lawyer


class FivePersonGame:
    def __init__(self, survivors:list, regulator):
        self.survivors = survivors
        self.regulator = regulator

    def process(self):
        self.regulator.beat(self.survivors[0])
        self.survivors[0].run()
        self.regulator.beat(self.survivors[1])
        self.survivors[1].inject(self.survivors[1])
        self.regulator.beat(self.survivors[1])
        self.regulator.beat(self.survivors[1])

    def process2(self):
        self.regulator.beat(self.survivors[2])
        self.regulator.cold_mist(self.survivors[2])
        self.regulator.beat(self.survivors[0])
        self.survivors[0].run()
        self.survivors[1].inject(self.survivors[0])


if __name__ == '__main__':
    gardener = Gardener('园丁',120,'护盾')
    doctor = Doctor('医生', 100,'打针')
    lawyer = Lawyer('律师', 110,'没有技能')
    lawyer2 = Lawyer('律师2',110,'没有技能')
    jack = Regulator('杰克','冷却')
    game = FivePersonGame([gardener, doctor, lawyer, lawyer2], jack)
    game.process()

    print("*" * 20)

    gardener = Gardener('园丁', 120, '护盾')
    doctor = Doctor('医生', 100, '打针')
    lawyer = Lawyer('律师', 110, '没有技能')
    lawyer2 = Lawyer('律师2', 110, '没有技能')
    jack = Jack('杰克', '冷却')
    game = FivePersonGame([gardener, doctor, lawyer, lawyer2], jack)
    game.process2()




